package util.math;
import java.util.ArrayList;
import java.util.List;

import org.junit.BeforeClass;
import org.junit.Test;

public class MathTest {
	

	static List<Double> lenList = new ArrayList<Double>();
	static MyMath mm;
	
	@BeforeClass
	public static void init() {

		for (int i = 10; i >0 ; i--) {
			double len = i;
			lenList.add(len);
		}
		//lenList.add(4.0);
		lenList.add(5.0);
		lenList.add(4.0);
		mm = new MyMath(lenList);
		
	}
	
	
	@Test
	public void testGetInterval() {
		IntervalCalc intervalCalc = new IntervalCalc(lenList);
		intervalCalc.setIntervalTimeList();
		List<Double> temp = intervalCalc.getIntervalTimeList();
		for (Double double1 : temp) {
			System.out.println(double1);
		}
	}
	
	@Test
	public void testGetMin() {
		System.out.println("最小值为：" + mm.getMin());
	}
	
	@Test
	public void testGetMax() {
		System.out.println("最大值为：" + mm.getMax());
	}


	@Test
	public void testGetAverage () {
		System.out.println("平均数为：" + mm.getAve());
	}
	
	@Test
	public void testMedian() {
		System.out.println("中值为：" + mm.getMedian());
	}

	@Test
	public void testGetVariance() {

		System.out.println("方差为：" + mm.getVarianceD());
		
	}
	
	@Test
	public void testGetStandard() {
		System.out.println("标准差为:" + mm.getStandard());
	}
	@Test
	public void testGetSkew() {
		System.out.println("偏度系数为：" + mm.getSkew());
	}
	
	@Test
	public void testGetKurt() {
		System.out.println("峰度系数为：" + mm.getKurt());
	}
	
	@Test
	public void testGetDecimal() {
		double i = 9.0004;
		
		System.out.println(mm.getDecimal(i));
	}
	
	

}












